﻿using CommunityToolkit.Maui;
using MauiSampleDemo.Samples.DatabaseOperate;
using MauiSampleDemo.Utilities;
using Microsoft.Extensions.Logging;

namespace MauiSampleDemo;

public static class MauiProgram
{
	public static MauiApp CreateMauiApp()
	{
		var builder = MauiApp.CreateBuilder();
		builder
			.UseMauiApp<App>()
            .UseMauiCommunityToolkit()
            .ConfigureFonts(fonts =>
			{
				fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
				fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
				fonts.AddFont("LedFont.ttf", "LedFont");
				fonts.AddFont("UnidreamLED.ttf", "UnidreamLED");
            });

#if DEBUG
		builder.Logging.AddDebug();
#endif
		builder.Services.AddTransient<ToastService>(); 
		builder.Services.AddSingleton<DatabaseService>(); 


        return builder.Build();
	}
}
